package com.bw.a2207a.db

import androidx.room.Dao
import androidx.room.Delete
import androidx.room.Insert
import androidx.room.OnConflictStrategy.REPLACE
import androidx.room.Query
import androidx.room.Update
import com.bw.a2207a.bean.LoginBean

/**
 *
 * @ClassName: UserDao
 * @Description: 用户数据库表，操作:增删改查
 * @Author: zhangyanchao
 * @CreateDate: 2024/10/22 4:07 PM
 * @Version: 1.0
 */

@Dao
interface UserDao {
    //添加一条数据
    @Insert(onConflict = REPLACE)
    fun insertUser(bean: LoginBean)

    @Query("select * from login_bean")
    fun queryUser():LoginBean

    @Update
    fun updateUser(bean: LoginBean)

    @Delete
    fun deleteUser(bean: LoginBean)

//    //删除改表的全部数据
//    @Query("delete from login_bean")
//    fun deleteUsers()

}